<<<<<<< HEAD
<?php
$url=isset($_GET['url'])?$_GET['url']:'';
?>
<?php if(!empty($url)):?>
    <div class="btn-group"><a href="<?php echo $url; ?>" class="btn"> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?> </a></div>
<?php else:?>
    <div class="btn-group"><a href="<?php echo site_url('user/index');?>" class="btn"> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?> </a></div>
<?php endif;?>
<?php include_once 'inc_form_errors.php'; ?>

<div class="boxed">
    <h3> <i class="fa fa-plus"></i> <span class="badge badge-success pull-right"><?php echo $title; ?></span> <?php echo lang('add') ?></h3>
    <?php echo form_open(current_url(),array("class"=>"form-horizontal","id"=>"frm-create")); ?>

    <div class="boxed-inner seamless">

        <div class="control-group">
            <label for="title" class="control-label">企业名称：</label>
            <div class="controls"><?php echo $it['company_name']; ?> <span class="help-inline" style="color: red">(<?php if($it['status']==0){ echo ''; }elseif($it['status']==1){echo '审核中';}elseif($it['status']==2){echo '审核通过';}else{ echo '审核失败';} ?>)</span></div>
        </div>
        <?php if($it['status']==1):?>
            <div class="control-group">
                <div class="controls">
                    审核是否通过：
                    <input type="button" id="tktg" value="是" class="btn ">&nbsp;&nbsp;&nbsp;<input type="button" id="tkjj" value="否" class="btn">
                    <span class="help-inline"></span>
                </div>
            </div>
        <?php endif;?>
        <div class="control-group">
            <label for="title" class="control-label">员工人数：</label>
            <div class="controls"><?php echo $it['company_employee_num']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">年营业额：</label>
            <div class="controls"><?php echo $it['sales_volume']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">工厂面积：</label>
            <div class="controls"><?php echo $it['acreage']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">工厂地址：</label>
            <div class="controls"><?php echo $it['province'].$it['city'].$it['area'].$it['detail']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">企业介绍：</label>
            <div class="controls"><?php echo $it['introduce']; ?></div>
        </div>

            <?php if($it['vr_status']==1):?>
                <div class="control-group">
                    <label for="title" class="control-label">VR申请状态：</label>
                    <div class="controls" style="color: #00bfa5"><?php echo '审核中'; ?></div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        VR地址审核是否通过：
                        <input type="button" id="thtg" value="是" class="btn ">&nbsp;&nbsp;&nbsp;<input type="button" id="thbtg" value="否" class="btn">
                        <span class="help-inline"></span>
                    </div>
                </div>
            <?php elseif($it['vr_status']==2):?>
                <div class="control-group">
                    <label for="title" class="control-label">VR申请状态：</label>
                    <div class="controls" style="color: #00bfa5"><?php echo '审核通过'; ?></div>
                </div>
                <?php if(!empty($it['vr_url'])):?>
                    <div class="control-group">
                        <label for="title" class="control-label">VR地址：</label>
                        <div class="controls"><?php echo $it['vr_url']; ?></div>
                    </div>
                <?php else:?>
                <div class="control-group">
                    <label class="control-label" for="vr_url">VR地址</label>
                    <div class="controls">
                        <input type="text" id="vr_url" name="vr_url" value="<?php echo set_value("vr_url") ?>" >
                        <br/>
                    </div>
                </div>
                <?php endif;?>
            <?php elseif($it['vr_status']==3):?>
                <div class="control-group">
                    <label for="title" class="control-label">VR申请状态：</label>
                    <div class="controls" style="color: #00bfa5"><?php echo '审核失败'; ?></div>
                </div>
            <?php endif;?>

        <div class="control-group">
            <label for="title" class="control-label">企业logo：</label>
            <div class="controls"><img src="<?php echo $it['photo']; ?>" width="100px" height="100px"></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">营业执照：</label>
            <div class="controls"><img src="<?php echo $it['photo1']; ?>" width="100px" height="100px"></div>
        </div>
        <div class="clear"></div>

    </div>
    <?php if($it['vr_status']==2):?>
        <div class="boxed-footer">
            <input type="hidden" name="id" value="<?php echo $it['id'] ?>">
            <input type="button" id="sub"  value=" <?php echo lang('submit'); ?> " class='btn btn-primary'>
            <input type="reset" value=' <?php echo lang('reset'); ?> ' class="btn btn-danger">
        </div>
    <?php endif;?>
    </form>
</div>
<div class="bootbox tcg modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">审核通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel" id="cancel" type="button" class="btn btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop tbcg fade hide in"></div>


<div class="bootbox sb modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">审核不通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel"  type="button" class="btn cancel btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm1" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop sb1 fade hide in"></div>
<div class="bootbox thtg modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">VR工厂审核通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel"  type="button" class="btn cancel btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm2" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop thtg1 fade hide in"></div>

<div class="bootbox thbtg modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">VR工厂审核不通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel"  type="button" class="btn cancel btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm3" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop thbtg1 fade hide in"></div>
<?php include_once 'inc_ui_media.php'; ?>

<script type="text/javascript">
    require(['adminer/js/ui','adminer/js/media', 'web/js/layer/layer','bootstrap-datetimepicker.zh'],function(ui,media,layer){
        layer.config({
            path: STATIC_URL + 'web/js/layer/' //layer.js所在的目录，可以是绝对目录，也可以是相对目录
        });
        // timepick
        $('.timepicker').datetimepicker({'language':'zh-CN','format':'yyyy/mm/dd hh:ii:ss','todayHighlight':true});
        // ueditor处理
        ui.editor_create('content');

        // media 上传
        media.init();
        var articles_photos = <?php echo json_encode(one_upload(set_value("photo"))) ?>;
        media.show(articles_photos,"photo");
        $('#sub').click(function(){
            var vr_url=$('#vr_url').val();
            var id="<?php echo $it['id'] ?>";
            var data={
                'id':id,
                'vr_url':vr_url,
                '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
            };
            $.ajax({
                type:"POST",
                dataType:"json",
                url: "<?php echo site_url('user/updateCompanyVr');?>",
                data: data,
                success: function(res){
                    switch (res.status) {
                        case 1:
                            layer.msg(res.msg, function () {
                                window.location.reload();
                            });
                            break;
                        default:
                            layer.msg(res.msg);
                            break;
                    }
                }
            });
        });


        var status=<?php echo $it['status']; ?>;
        $('#tktg').click(function(){//退款审核通过
            $(this).addClass('btn-primary');
            $('#tkjj').removeClass('btn-primary');
            if(status==1){
                $('.tcg').removeClass('hide');
                $('.tbcg').removeClass('hide');
                $('#confirm').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateCompanyStatus');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        $('#tkjj').click(function(){//退款审核不通过
            $(this).addClass('btn-primary');
            $('#tktg').removeClass('btn-primary');
            if(status==1){
                $('.sb').removeClass('hide');
                $('.sb1').removeClass('hide');
                $('#confirm1').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateCompanyStatusNo');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        var vr_status=<?php echo $it['status']; ?>;
        $('#thtg').click(function(){//退款并退货审核通过vr_status
            $(this).addClass('btn-primary');
            $('#thbtg').removeClass('btn-primary');
            if(vr_status==1){
                $('.thtg').removeClass('hide');
                $('.thtg1').removeClass('hide');
                $('#confirm2').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        'vr_status':2,////通过
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateVrstatus');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        $('#thbtg').click(function(){//退款并退货审核不通过
            $(this).addClass('btn-primary');
            $('#thtg').removeClass('btn-primary');
            if(vr_status==1){
                $('.thbtg').removeClass('hide');
                $('.thbtg1').removeClass('hide');
                $('#confirm3').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        'vr_status':3,//不通过
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateVrstatus');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        $('.cancel').click(function(){
            $('.sb').addClass('hide');
            $('.sb1').addClass('hide');
            $('.modal-backdrop').addClass('hide');
            $('.bootbox').addClass('hide');
        });
        $('.fa-times').click(function(){
            $('.sb').addClass('hide');
            $('.sb1').addClass('hide');
            $('.modal-backdrop').addClass('hide');
            $('.bootbox').addClass('hide');
        });
    });

</script>
=======
<?php
$url=isset($_GET['url'])?$_GET['url']:'';
?>
<?php if(!empty($url)):?>
    <div class="btn-group"><a href="<?php echo $url; ?>" class="btn"> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?> </a></div>
<?php else:?>
    <div class="btn-group"><a href="<?php echo site_url('user/index');?>" class="btn"> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?> </a></div>
<?php endif;?>
<?php include_once 'inc_form_errors.php'; ?>

<div class="boxed">
    <h3> <i class="fa fa-plus"></i> <span class="badge badge-success pull-right"><?php echo $title; ?></span> <?php echo lang('add') ?></h3>
    <?php echo form_open(current_url(),array("class"=>"form-horizontal","id"=>"frm-create")); ?>

    <div class="boxed-inner seamless">

        <div class="control-group">
            <label for="title" class="control-label">企业名称：</label>
            <div class="controls"><?php echo $it['company_name']; ?> <span class="help-inline" style="color: red">(<?php if($it['status']==0){ echo ''; }elseif($it['status']==1){echo '审核中';}elseif($it['status']==2){echo '审核通过';}else{ echo '审核失败';} ?>)</span></div>
        </div>
        <?php if($it['status']==1):?>
            <div class="control-group">
                <div class="controls">
                    审核是否通过：
                    <input type="button" id="tktg" value="是" class="btn ">&nbsp;&nbsp;&nbsp;<input type="button" id="tkjj" value="否" class="btn">
                    <span class="help-inline"></span>
                </div>
            </div>
        <?php endif;?>
        <div class="control-group">
            <label for="title" class="control-label">员工人数：</label>
            <div class="controls"><?php echo $it['company_employee_num']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">年营业额：</label>
            <div class="controls"><?php echo $it['sales_volume']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">工厂面积：</label>
            <div class="controls"><?php echo $it['acreage']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">工厂地址：</label>
            <div class="controls"><?php echo $it['province'].$it['city'].$it['area'].$it['detail']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">企业介绍：</label>
            <div class="controls"><?php echo $it['introduce']; ?></div>
        </div>

            <?php if($it['vr_status']==1):?>
                <div class="control-group">
                    <label for="title" class="control-label">VR申请状态：</label>
                    <div class="controls" style="color: #00bfa5"><?php echo '审核中'; ?></div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        VR地址审核是否通过：
                        <input type="button" id="thtg" value="是" class="btn ">&nbsp;&nbsp;&nbsp;<input type="button" id="thbtg" value="否" class="btn">
                        <span class="help-inline"></span>
                    </div>
                </div>
            <?php elseif($it['vr_status']==2):?>
                <div class="control-group">
                    <label for="title" class="control-label">VR申请状态：</label>
                    <div class="controls" style="color: #00bfa5"><?php echo '审核通过'; ?></div>
                </div>
                <?php if(!empty($it['vr_url'])):?>
                    <div class="control-group">
                        <label for="title" class="control-label">VR地址：</label>
                        <div class="controls"><?php echo $it['vr_url']; ?></div>
                    </div>
                <?php else:?>
                <div class="control-group">
                    <label class="control-label" for="vr_url">VR地址</label>
                    <div class="controls">
                        <input type="text" id="vr_url" name="vr_url" value="<?php echo set_value("vr_url") ?>" >
                        <br/>
                    </div>
                </div>
                <?php endif;?>
            <?php elseif($it['vr_status']==3):?>
                <div class="control-group">
                    <label for="title" class="control-label">VR申请状态：</label>
                    <div class="controls" style="color: #00bfa5"><?php echo '审核失败'; ?></div>
                </div>
            <?php endif;?>

        <div class="control-group">
            <label for="title" class="control-label">企业logo：</label>
            <div class="controls"><img src="<?php echo $it['photo']; ?>" width="100px" height="100px"></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">营业执照：</label>
            <div class="controls"><img src="<?php echo $it['photo1']; ?>" width="100px" height="100px"></div>
        </div>
        <div class="clear"></div>

    </div>
    <?php if($it['vr_status']==2):?>
        <div class="boxed-footer">
            <input type="hidden" name="id" value="<?php echo $it['id'] ?>">
            <input type="button" id="sub"  value=" <?php echo lang('submit'); ?> " class='btn btn-primary'>
            <input type="reset" value=' <?php echo lang('reset'); ?> ' class="btn btn-danger">
        </div>
    <?php endif;?>
    </form>
</div>
<div class="bootbox tcg modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">审核通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel" id="cancel" type="button" class="btn btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop tbcg fade hide in"></div>


<div class="bootbox sb modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">审核不通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel"  type="button" class="btn cancel btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm1" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop sb1 fade hide in"></div>
<div class="bootbox thtg modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">VR工厂审核通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel"  type="button" class="btn cancel btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm2" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop thtg1 fade hide in"></div>

<div class="bootbox thbtg modal hide fade in" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="bootbox-close-button close" style="margin-top: -10px;"><i class="fa fa-times"></i></button>
                <div class="bootbox-body" id="text">VR工厂审核不通过！</div>
            </div>
            <div class="modal-footer">
                <button data-bb-handler="cancel"  type="button" class="btn cancel btn-default">取消</button>
                <button data-bb-handler="confirm" id="confirm3" type="button" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>
<div class="modal-backdrop thbtg1 fade hide in"></div>
<?php include_once 'inc_ui_media.php'; ?>

<script type="text/javascript">
    require(['adminer/js/ui','adminer/js/media', 'web/js/layer/layer','bootstrap-datetimepicker.zh'],function(ui,media,layer){
        layer.config({
            path: STATIC_URL + 'web/js/layer/' //layer.js所在的目录，可以是绝对目录，也可以是相对目录
        });
        // timepick
        $('.timepicker').datetimepicker({'language':'zh-CN','format':'yyyy/mm/dd hh:ii:ss','todayHighlight':true});
        // ueditor处理
        ui.editor_create('content');

        // media 上传
        media.init();
        var articles_photos = <?php echo json_encode(one_upload(set_value("photo"))) ?>;
        media.show(articles_photos,"photo");
        $('#sub').click(function(){
            var vr_url=$('#vr_url').val();
            var id="<?php echo $it['id'] ?>";
            var data={
                'id':id,
                'vr_url':vr_url,
                '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
            };
            $.ajax({
                type:"POST",
                dataType:"json",
                url: "<?php echo site_url('user/updateCompanyVr');?>",
                data: data,
                success: function(res){
                    switch (res.status) {
                        case 1:
                            layer.msg(res.msg, function () {
                                window.location.reload();
                            });
                            break;
                        default:
                            layer.msg(res.msg);
                            break;
                    }
                }
            });
        });


        var status=<?php echo $it['status']; ?>;
        $('#tktg').click(function(){//退款审核通过
            $(this).addClass('btn-primary');
            $('#tkjj').removeClass('btn-primary');
            if(status==1){
                $('.tcg').removeClass('hide');
                $('.tbcg').removeClass('hide');
                $('#confirm').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateCompanyStatus');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        $('#tkjj').click(function(){//退款审核不通过
            $(this).addClass('btn-primary');
            $('#tktg').removeClass('btn-primary');
            if(status==1){
                $('.sb').removeClass('hide');
                $('.sb1').removeClass('hide');
                $('#confirm1').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateCompanyStatusNo');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        var vr_status=<?php echo $it['status']; ?>;
        $('#thtg').click(function(){//退款并退货审核通过vr_status
            $(this).addClass('btn-primary');
            $('#thbtg').removeClass('btn-primary');
            if(vr_status==1){
                $('.thtg').removeClass('hide');
                $('.thtg1').removeClass('hide');
                $('#confirm2').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        'vr_status':2,////通过
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateVrstatus');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        $('#thbtg').click(function(){//退款并退货审核不通过
            $(this).addClass('btn-primary');
            $('#thtg').removeClass('btn-primary');
            if(vr_status==1){
                $('.thbtg').removeClass('hide');
                $('.thbtg1').removeClass('hide');
                $('#confirm3').click(function(){
                    var id="<?php echo $it['id'] ?>";
                    var data={
                        'id':id,
                        'vr_status':3,//不通过
                        '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>',
                    };
                    $.ajax({
                        type:"POST",
                        dataType:"json",
                        url: "<?php echo site_url('user/updateVrstatus');?>",
                        data: data,
                        success: function(res){
                            switch (res.status) {
                                case 1:
                                    layer.msg(res.msg, function () {
                                        window.location.reload();
                                    });
                                    break;
                                default:
                                    layer.msg(res.msg);
                                    break;
                            }
                        }
                    });
                });
            }else{
                alert('该状态不能完成此操作！');
            }
        });
        $('.cancel').click(function(){
            $('.sb').addClass('hide');
            $('.sb1').addClass('hide');
            $('.modal-backdrop').addClass('hide');
            $('.bootbox').addClass('hide');
        });
        $('.fa-times').click(function(){
            $('.sb').addClass('hide');
            $('.sb1').addClass('hide');
            $('.modal-backdrop').addClass('hide');
            $('.bootbox').addClass('hide');
        });
    });

</script>
>>>>>>> 354f4b2fb2288b3c61dba6a59b3136f80f4b6909
